<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>ABC</title>
</head>

<hr/>
HAHAHAHAHA
你好，<p>[[${session.loginUser}]]</p>
<a th:href="@{/loginout}">注销</a>
<a th:href="@{/allEmployees}">获取所有员工</a>

<h4 th:text="${emps}"></h4>
<table>
    <thead>
        <tr>
            <th>id</th>
            <th>lastName</th>
            <th>email</th>
            <th>gender</th>
            <th>birth</th>
            <th>dapartment</th>
        </tr>
    </thead>
    <tbody>
    <tr th:each="emp:${emps}">
        <th th:text="${emp.getId()}"></th>
        <th>[[${emp.getLastname()}]]</th>
        <th th:text="${emp.getEmail()}"></th>
        <th>[[${emp.getGender()==1?"男":"女"}]]</th>
        <th th:text="${#dates.format(emp.getBirth(),'yyyy-MM-dd')}">id</th>
        <th>[[${emp.department.getDepartmentName()}]]</th>
        <th><a th:href="@{/updateEmp/}+${emp.getId()}"><button>编辑</button></a></th>
        <th><a th:href="@{/deleteEmp/}+${emp.getId()}"><button>删除</button></a></th>
    </tr>
    </tbody>
</table>
<a th:href="@{/addEmp}"><button>添加员工</button></a>
</body>
</html>
